From: Jo-Philipp Wich Date: Mon, 26 Sep 2022 08:50:40 +0000 (+0200) Subject: luci-base: sys.uc: increase init script START/STOP search space X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=60a9f019780f43a1b9d198451bd20ee8ae66f2aa;p=project%2Fluci.git luci-base: sys.uc: increase init script START/STOP search space Some init scripts, such as the sysfsutils one, declare their START or STOP variables very late in the file. Duplicate the search buffer to 2048 byte in order to catch these cases. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/ucode/sys.uc b/modules/luci-base/ucode/sys.uc index d4db91a9b9..5bbaa8b19d 100644 --- a/modules/luci-base/ucode/sys.uc +++ b/modules/luci-base/ucode/sys.uc @@ -121,7 +121,7 @@ export function init_list() { }; export function init_index(name) { - const src = readfile(`/etc/init.d/${basename(name)}`, 1024); + const src = readfile(`/etc/init.d/${basename(name)}`, 2048); const idx = []; for (let m in match(src, /^[[:space:]]*(START|STOP)=('[0-9][0-9]'|"[0-9][0-9]"|[0-9][0-9])[[:space:]]*$/gs)) {